package it.desertsupport.model;

public class Defence {
	
	private Long idDefence;
	private String weapon;
	private Long price;
	private Long defencePoints;
	private String constructionTime;
	
	// Constructors
	public Defence() {}

	public Defence(String weapon, Long price, Long defencePoints,
			String constructionTime) {
		super();
		this.weapon = weapon;
		this.price = price;
		this.defencePoints = defencePoints;
		this.constructionTime = constructionTime;
	}

	public Defence(Long idDefence, String weapon, Long price,
			Long defencePoints, String constructionTime) {
		this.idDefence = idDefence;
		this.weapon = weapon;
		this.price = price;
		this.defencePoints = defencePoints;
		this.constructionTime = constructionTime;
	}
	
	// Getter and Setter
	public Long getIdDefence() {
		return this.idDefence;
	}
	public void setIdDefence(Long idDefence) {
		this.idDefence = idDefence;
	}

	public String getWeapon() {
		return this.weapon;
	}
	public void setWeapon(String weapon) {
		this.weapon = weapon;
	}

	public Long getPrice() {
		return this.price;
	}
	public void setPrice(Long price) {
		this.price = price;
	}

	public Long getDefencePoints() {
		return this.defencePoints;
	}
	public void setDefencePoints(Long defencePoints) {
		this.defencePoints = defencePoints;
	}

	public String getConstructionTime() {
		return this.constructionTime;
	}
	public void setConstructionTime(String constructionTime) {
		this.constructionTime = constructionTime;
	}

	// Methods
	@Override
	public String toString() {
		return "Defence [idDefence=" + idDefence + ", weapon=" + weapon
				+ ", price=" + price + ", defencePoints=" + defencePoints
				+ ", constructionTime=" + constructionTime + "]";
	}
	
	@Override
	public boolean equals(Object object) {
		if(object == null || !(object instanceof Defence)){
			return false;
		}
		Defence defence = (Defence) object;
		return defence.getIdDefence() == this.idDefence;
	}
	
}
